package com.design.pattern.flyweight;

public class Client {
    public static void main(String[] args) {
        CarFlyWeight blackCar= LittleCarFlyWeightFactory.get("black");
        CarFlyWeight blackCar2= LittleCarFlyWeightFactory.get("black");
       // System.out.println(blackCar.hashCode());
        //System.out.println(blackCar2.hashCode());
//        blackCar.display(new Coordinate(10,10,10));
//        blackCar2.display(new Coordinate(15,15,15));
        CarFlyWeight bigCar=BigCarFlyWeightFactory.get(6);
        CarFlyWeight bigCar2=BigCarFlyWeightFactory.get(6);
        CarFlyWeight bigCar3=BigCarFlyWeightFactory.get(12);
        //System.out.println(bigCar.hashCode());
        //System.out.println(bigCar2.hashCode());
        //System.out.println(bigCar3.hashCode());
//        bigCar.display(new Coordinate(10,10,10));
//        bigCar2.display(new Coordinate(101,101,101));
//        bigCar3.display(new Coordinate(102,102,102));
        LittleCarFlyWeightFactory.delete((LittleConcreteFlyWeight) blackCar);
        blackCar= LittleCarFlyWeightFactory.get("black");
//        System.out.println(blackCar.hashCode());
        //================================================
        CarUnSharedConcreteFlyWeight carFlyWeightUnShared=new CarUnSharedConcreteFlyWeight();
        carFlyWeightUnShared.add(blackCar);
        carFlyWeightUnShared.add(blackCar2);
        carFlyWeightUnShared.add(bigCar);
        carFlyWeightUnShared.add(bigCar2);
        carFlyWeightUnShared.add(bigCar3);
        carFlyWeightUnShared.display(new Coordinate(101,101,101));
    }
}
